package fhjoanneum.itm11.antesk.simplehack;
import java.util.*;

public class Dice
{
	// Members -----------------------------------------------------------
	private Random random;
	private int min;
	private int max;
	
	// Constructors ------------------------------------------------------
	Dice()
	{
		random = new Random();
		this.min = 1;
		this.max = 10;
	}
	Dice(int min, int max)
	{
		random = new Random();
		this.min = min;
		this.max = max;
	}
	
	// Methods ===========================================================
	
	// Getters and setters -----------------------------------------------
	public int getMin(){return min;}
	public void setMin(int min){this.min = min;}
	public int getMax(){return max;}
	public void setMax(int max){this.max = max;}
	
	/**
	 * Returns an integer between and including the min and max values.
	 * 
	 * @return integer between specified range.
	 */
	public int roll()
	{
		return random.nextInt(max) + min;
	}
	
	/**
	 * Returns a random value between 0.0 and 1.0 as double.
	 * 
	 * @return double random number between 0.0 and 1.0
	 */
	public double random()
	{
		return random.nextDouble();
	}
}
